/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;

/**
 * 顾客检查参数表Entity
 * @author liujiang
 * @version 2013-06-14
 */
@Entity
@Table(name = "store_customer_exam_parameters")
@IdClass(ExamParameterPK.class)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CustomerExamParameters extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private CustomerExam customerExam; // 范围
	private Parameter parameter; // 范围

	public CustomerExamParameters() {
	}

	@Id
	@ManyToOne(cascade=CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name="SCE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public CustomerExam getCustomerExam() {
		return customerExam;
	}

	public void setCustomerExam(CustomerExam customerExam) {
		this.customerExam = customerExam;
	}
	
	@Id
	@ManyToOne(cascade=CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name="PARAMETER_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Parameter getParameter() {
		return parameter;
	}

	public void setParameter(Parameter parameter) {
		this.parameter = parameter;
	}
}

